<template>
  <wd-tabbar v-model="props.modelValue" fixed placeholder safeAreaInsetBottom @change="tabbarChange">
    <wd-tabbar-item icon="home" title="首页" :name="0"></wd-tabbar-item>
    <wd-tabbar-item icon="user" title="我的" :name="1"></wd-tabbar-item>
  </wd-tabbar>
</template>

<script setup lang="ts">
const props = defineProps<{ modelValue: number }>()

const tabbarChange = ({value}: { value: number }) => {
  if (value === 0) {
    uni.navigateTo({
      url: '/pages/index/index',
    })
  }else if (value === 1) {
    uni.navigateTo({
      url: '/pages/my/index',
    })
  }
}
</script>

<style scoped lang="scss">

</style>